﻿using System;

using SharedGenomics.Core;

namespace SharedGenomics.Workbench.Models
{
    public class CoverflowUriResolver : ICoverflowUriResolver
    {
        private readonly Uri baseUri;

        public CoverflowUriResolver(Uri baseUri)
        {
            baseUri.ThrowIfNull("baseUri");
            this.baseUri = baseUri;
        }

        public Uri ResolveUri(Guid sessionId, SessionAnnotationDisplayImportance displayImportance)
        {
            UriBuilder builder = new UriBuilder(this.baseUri);
            builder.Query = String.Format("id={0}&show={1}", sessionId, displayImportance.ToString().ToLower());
            return builder.Uri;
        }
    }
}
